<template>
	<hr class="two" />
	<h2>==== IsReactive 判断是不是一些类型 ===</h2>
	<h3>我是App组件</h3>
	<button @click="showIs">IsApi</button>
	<br>
	<br>

</template>

<script>
import {ref, reactive, toRefs, readonly, isRef, isReactive, isReadonly, isProxy} from 'vue'

export default {
	name: 'IsReactive',
	setup() {
		let car = reactive({name: '奔驰', price: '40W'})
		let sum = ref(0)
		let car2 = readonly(car)                  //处理之后依然是Object 类型

		function showIs() {
			console.log('isRef(sum)', isRef(sum))
			console.log('isReactive(car)', isReactive(car))
			console.log('isReadonly(car2)', isReadonly(car2))
			console.log('isProxy(car)', isProxy(car))
			console.log('isProxy(sum)', isProxy(sum))

		}


		return {...toRefs(car), showIs}
	}
}
</script>

<style>
.app {
	background-color: gray;
	padding: 10px;
}
</style>